/*
 ============================================================================
 Name        : fIconView.cpp
 Author      :
 Version     :
 Copyright   : Your copyright notice
 Description : fIconView implementation
 ============================================================================
 */
#include <COEUTILS.H>
#include <s32file.h>
#include <f32file.h>
#include <COEMAIN.H>
#include "HomepageCvs.h"
#include "MagazineCanvasManager.h"
#include "fFile.h"
#include "fFont.h"
#include "fUtility.h"
#include "fFramework.h"
#include "fIconView.h"
#include "MagazineFramework.h"
#include "fImageUtility.h"
#include "ProjectsDefines.h"

fIconView::fIconView( )
{
}

fIconView::~fIconView( )
{

}

fIconView* fIconView::NewLC( fEngine* aEngine, fImage* aIcon )
{
    fIconView* self = new ( ELeave ) fIconView( );
    CleanupStack::PushL( self );
    self->ConstructL( aEngine, aIcon );
    return self;
}

fIconView* fIconView::NewL( fEngine* aEngine, fImage* aIcon )
{
    fIconView* self = fIconView::NewLC( aEngine, aIcon );
    CleanupStack::Pop( ); // self;
    return self;
}

void fIconView::ConstructL( fEngine* aEngine, fImage* aIcon )
{
    BaseInit( aEngine );
    _Icon = aIcon;
    if( _Icon )
    {
        SetCtlSize( _Icon->Width( ), _Icon->Height( ) );
    }
}

void fIconView::SizeToContent( )
{
    if( _Icon )
    {
        SetCtlSize( _Icon->Width( ), _Icon->Height( ) );
    }
}

void fIconView::RenderFrame( )
{
    if( !iIsVisible )
    {
        return;
    }

    iGfx->DrawTransImage( Left( ), Top( ), _Icon, 0 );
}

void fIconView::HandleKey( f_KEY_DES* /*aKeyDes*/)
{

}

TInt fIconView::HandleMouse( fMouseEvent /*nType*/, TPoint /*sPoint*/ )
{

    return 0;
}
